home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
asm
/
alib11b.zip
/
CODE1.ZIP
/
DISKFILE
/
EXIST.ASM
next >
Wrap
Assembly Source File
|
1994-10-04
|
560b
|
22 lines
;----------------------------------------------------------------------------
;FILE_EXIST - determines if a file exists and can be opened
;
; inputs: DS:[DX] pointing to ASCIIZ filename
;
; output: if CF = 0, file exists
; if CF = 1, AX = DOS error code
;* * * * * * * * * * * * * *
public FILE_EXIST
FILE_EXIST PROC FAR
push bx
mov ax,3d00h ;open file at ds:dx
INT 21h
JB FEX_EXIT
MOV BX,AX
MOV AH,3Eh ;close file
INT 21h
FEX_EXIT:
POP BX
RETF
FILE_EXIST ENDP